package com.sgcc.system.api;

import java.util.List;
import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.sgcc.common.core.constant.ServiceNameConstants;
import com.sgcc.common.core.domain.R;
import com.sgcc.common.core.web.domain.AjaxResult;
import com.sgcc.common.core.web.page.TableDataInfo;
import com.sgcc.system.api.domain.SysUser;
import com.sgcc.system.api.factory.RemoteUserFallbackFactory;
import com.sgcc.system.api.model.LoginUser;

/**
 * 用户服务
 * 
 * @author sgcc
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @GetMapping(value = "/user/info/{username}")
    public R<LoginUser> getUserInfo(@PathVariable("username") String username);
    
    @RequestMapping(value = "/user/list")
	public TableDataInfo selectUserList(@RequestBody SysUser user);
    
    @RequestMapping(value = "/user/selectUserListByRoleKey")
	public TableDataInfo selectUserListByRoleKey(@RequestParam("roleKey") String roleKey);
    
    @RequestMapping(value = "/user/selectUserByUserName")
	public SysUser selectUserByUserName(@RequestParam("userId") String userId);
    
    @PostMapping("/user/addIsc")
    public R<Integer> addIsc(@Validated @RequestBody SysUser user);
    
    @PutMapping("/user/editIsc")
    public R<Integer> editIsc(@Validated @RequestBody SysUser user);
    
    @GetMapping("/user/getInfoISC")
    public R<SysUser> getInfoISC(@RequestParam("id") String id);
    

    @PutMapping("/user/insertUserRole")
	public AjaxResult insertUserRole(@RequestParam("userId") String userId, @RequestParam("ids") String ids);

    @GetMapping(value = "/user/selectUserByUserId/{id}")
    public SysUser selectUserByUserId(@PathVariable("id") String id);
}
